home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH13 / 13-1-2PF.CLS < prev    next >
Encoding:
Visual Basic class definition  |  1998-09-20  |  1.2 KB  |  55 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "CPFStudent"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. 'Pass/Fail Student Class
  15. Private m_name As String
  16. Private m_ssn As String
  17. Private m_midterm As Single
  18. Private m_final As Single
  19.  
  20. Property Get Name() As String
  21.   Name = m_name
  22. End Property
  23.  
  24. Property Let Name(ByVal vName As String)
  25.   m_name = vName
  26. End Property
  27.  
  28. Property Get SocSecNum() As String
  29.   SocSecNum = m_ssn
  30. End Property
  31.  
  32. Property Let SocSecNum(ByVal vNum As String)
  33.   m_ssn = vNum
  34. End Property
  35.  
  36. Property Let midGrade(ByVal vGrade As Single)
  37.   m_midterm = vGrade
  38. End Property
  39.  
  40. Property Let finGrade(ByVal vGrade As Single)
  41.   m_final = vGrade
  42. End Property
  43.  
  44. Public Function SemGrade() As String
  45.  Dim grade As Single
  46.   grade = (m_midterm + m_final) / 2
  47.   grade = Round(grade)   'Round the grade
  48.   If grade >= 60 Then
  49.       SemGrade = "Pass"
  50.     Else
  51.       SemGrade = "Fail"
  52.   End If
  53. End Function
  54.  
  55.